#include "iostream"
using namespace std;
class A
{
	
public:
	void display()
	{
		cout<<x<<endl;
	}

protected:
private:
	int x;
	//b是a的好朋友	
	friend class B;
};

class B
{
public:
	void setA(int x)
	{
		Aobj.x = x;
	}
	void printA()
	{
		cout<<Aobj.x<<endl;
	}
protected:
private:
	A Aobj;
};

int main()
{
	B b1;
	b1.setA(100);
	b1.printA();
	return 0;
}